let marbleRaceLevel10_5 = {
	name: 'Game 10 Level 5',
	id: '10_5',
	type: 'elimination',
	eliminated: 1,
	objects: [
		// Portals
		{
			type: 'object',
			shape: 'rect',
			color: '@goal',
			toPortal: 'goal',
			isGoal: true,
			x: 340,
			y: 540 - 10,
			width: 520,
			height: 20
		},
		{
			type: 'object',
			shape: 'circle',
			color: '@a',
			portalID: 'a',
			x: 340,
			y: 80,
			radius: 5,
			onBeforeUpdate:function (object, engine) {
				engine.setPosition(object.body, [340 + 200 * Math.sin(engine.time), 80])
			}
		},

		// Goal portal
		{
			type: 'object',
			shape: 'circle',
			color: '@goal',
			portalID: 'goal',
			x: 700,
			y: 80,
			radius: 5
		},

		// Obstacles

		// Borders
		{
			type: 'object',
			shape: 'rect',
			color: '@tertiary',
			x: 400,
			y: 0,
			width: 800,
			height: 120
		},
		{
			type: 'object',
			shape: 'rect',
			color: '@tertiary',
			x: 400,
			y: 600,
			width: 800,
			height: 120
		},
		{
			type: 'object',
			shape: 'rect',
			color: '@tertiary',
			x: 0,
			y: 300,
			width: 160,
			height: 600
		},
		{
			type: 'object',
			shape: 'rect',
			color: '@tertiary',
			x: 800,
			y: 300,
			width: 160,
			height: 600
		},
		{
			type: 'object',
			shape: 'rect',
			color: '@tertiary',
			x: 640,
			y: 300,
			width: 80,
			height: 600
		},

		// Marbles
		{
			type: 'marbles',
			x: 340,
			y: 80,
			launchTime: 3,
			launchRadius: 75,
			passX: 700,
			passY: 80,
			radius: 8,
			eliminatedRadius: 6,
			velocity: 5
		},
	]
}
{
	let cntI = 1
	for (let i = 0; i <= cntI; ++i) {
		let cntJ = 2
		for (let j = 0; j <= cntJ; ++j) {
			let x = 340 + (j - cntJ * .5) * 520 / 3, y = 300 + (i - cntI * .5) * 150
			marbleRaceLevel10_5.objects.push({
				type: 'object',
				shape: 'rect',
				width: 520 / 6,
				height: 20,
				color: '@a',
				toPortal: 'a',
				x: x,
				y: y,
				onBeforeUpdate: function (object, engine) {
					let phase = .5 * engine.time
					if (i & 1)
						phase += .5
					phase -= Math.floor(phase)
					if (phase < .5)
						phase = -520 / 12
					else
						phase = 520 / 12
					engine.setPosition(object.body, [x + phase, y])
				}
			})
		}
	}
}
marbleRaceLevels.push(marbleRaceLevel10_5)